package com.example.departmentService.controller;

import com.example.departmentService.entity.dto.ProjectListDto;
import com.example.departmentService.entity.dto.QueryConditions;
import com.example.departmentService.entity.vo.ProjectListVo;
import com.example.departmentService.service.IProjectInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@Api(value = "/projectInfo", tags = "项目查询")
@RestController
@RequestMapping("/projectInfo")
public class ProjectInfoController {

    @Autowired
    private IProjectInfoService projectInfoService;

    @ApiOperation(value = "数据展示", notes = "数据展示")
    @PostMapping("/queryList")
    @CrossOrigin(origins = "*")
    public List<ProjectListVo> queryPage(@RequestBody QueryConditions queryConditions) {
        return projectInfoService.queryList(queryConditions);
    }
    @ApiOperation(value = "添加项目", notes = "添加项目")
    @PostMapping("/insert")
    @CrossOrigin(origins = "*")
    public Integer insert(@RequestBody ProjectListDto projectListDto) {
        return projectInfoService.insert(projectListDto);
    }
}
